package com.lex.cheeseStrip.app;

import com.dh.cheesestrip.Util.LogUtil;
import com.lex.cheeseStrip.util.WebSocketUtil;

import org.java_websocket.handshake.ServerHandshake;

/**
 * Created by Mc on 2016/10/17.
 */

public class WebSocketCallback implements WebSocketUtil.WebSocketListener {

    @Override
    public void onOpen(ServerHandshake handshake) {
        LogUtil.d("WebSocket已连接");
    }

    @Override
    public void onMessage(String s) {
        LogUtil.d("收到消息: " + s);
    }

    @Override
    public void onClose(int i, String s, boolean b) {
        LogUtil.e("WebSocket已关闭 :" + s);
    }

    @Override
    public void onError(Exception e) {
        LogUtil.e("WebSocket异常: " + e.getMessage());
    }
}
